home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / TOTDEMO.ARJ / DEMIO10.PAS < prev    next >
Pascal/Delphi Source File  |  1991-02-11  |  2KB  |  86 lines

  1. program DemoIOTen;
  2. {demIO8 - date field input}
  3. Uses DOS, CRT,
  4.      totFAST, totIO1, totIO2, totDate;
  5.  
  6. var
  7.   Field1, Field2,
  8.   Field3, Field4: DateIOOBJ;
  9.   Keys: ControlKeysIOOBJ;
  10.   Manager: FormOBJ;
  11.  
  12. procedure InitVars;
  13. {}
  14. begin
  15.    with Field1 do
  16.    begin
  17.       Init(40,3,MMDDYY);
  18.       SetLabel('Field 1   (MMDDYY)');
  19.       SetMessage(30,25,'Default settings');
  20.    end;
  21.    with Field2 do
  22.    begin
  23.       Init(40,5,MMDDYY);
  24.       SetLabel('Field 2   (MMDDYY)');
  25.       SetValue(TodayInJul);
  26.       SetRules(EraseDefault+JumpIfFull);
  27.       SetMessage(5,25,'SetValue(TodayInJul); SetRules(EraseDefault+JumpIfFull);');
  28.    end;
  29.    with Field3 do
  30.    begin
  31.       Init(40,7,DDMMYYYY);
  32.       SetLabel('Field 3 (DDMMYYYY)');
  33.       SetMessage(30,25,'Default settings');
  34.    end;
  35.    with Field4 do
  36.    begin
  37.       Init(40,9,DDMMYYYY);
  38.       SetLabel('Field 4 (DDMMYYYY)');
  39.       SetMinMax(GregtoJul(3,1,1992),GregtoJul(3,31,1992));
  40.       SetCursor(CursLeft);
  41.       SetMessage(23,25,'SetCursor(CursLeft); SetMinMax ...');
  42.    end;
  43.    Keys.Init;
  44. end; {InitVars}
  45.  
  46. procedure DisposeVars;
  47. {}
  48. begin
  49.    Field1.Done;
  50.    Field2.Done;
  51.    Field3.Done;
  52.    Field4.Done;
  53.    Keys.Done;
  54. end; {DisposeVars}
  55.  
  56. begin
  57.    InitVars;
  58.    ClrScr;
  59.    Screen.FillBox(10,2,70,11,79,1);
  60.    Screen.WriteCenter(11,79,' Press Tab to change fields. F10 to finish. ');
  61.    with Manager do
  62.    begin
  63.       Init;
  64.       AddItem(Keys);
  65.       AddItem(Field1);
  66.       AddItem(Field2);
  67.       AddItem(Field3);
  68.       AddItem(Field4);
  69.       if Go = Finished then
  70.       begin
  71.          GotoXY(1,18);
  72.          writeln('Your input was:');
  73.          writeln('Field 1: ',FancyDateStr(Field1.GetValue,true,true));
  74.          writeln('Field 2: ',FancyDateStr(Field2.GetValue,true,true));
  75.          writeln('Field 3: ',FancyDateStr(Field3.GetValue,true,true));
  76.          writeln('Field 4: ',FancyDateStr(Field4.GetValue,true,true));
  77.       end
  78.       else
  79.       begin
  80.          GotoXY(1,20);
  81.          writeln('You escaped!');
  82.       end;
  83.       DisposeVars;
  84.       Done;
  85.    end;
  86. end.